package org.infinispan.query.queries;

import java.util.Objects;

import org.infinispan.api.annotations.indexing.Basic;
import org.infinispan.api.annotations.indexing.Indexed;

/**
 * A new additional entity type for testing Infinispan Querying.
 *
 * @author Anna Manukyan
 */
@Indexed(index = "numeric")
public class NumericType {

   private final int num1;

   private final int num2;

   private String name;

   public NumericType(int num1, int num2) {
      this.num1 = num1;
      this.num2 = num2;
   }

   @Basic(projectable = true)
   public int getNum1() {
      return num1;
   }

   @Basic(projectable = true)
   public int getNum2() {
      return num2;
   }

   @Basic(projectable = true)
   public String getName() {
      return name;
   }

   @Override
   public boolean equals(Object o) {
      if (o == null || getClass() != o.getClass()) return false;
      NumericType that = (NumericType) o;
      return num1 == that.num1 && num2 == that.num2 && Objects.equals(name, that.name);
   }

   @Override
   public int hashCode() {
      return Objects.hash(num1, num2, name);
   }

   public void setName(String name) {
      this.name = name;
   }

}
